from django.shortcuts import render, redirect
from user.models import User


def IndexView(request):
    userid = request.session.get('userid', 0)
    if userid == 0:
        return redirect('user:login')
    else:
        user = User.objects.get(id=userid)
    return render(request, "dash/index.html", locals())
